module Singly
  module Logger
    def log(msg)
      return unless Singly.verbose
      if defined?(Rails)
        Rails.logger.info("[singly] #{msg}")  # Naive logging.
                                              # This lumberjack will log in Rails if defined.
                                              # Otherwise it just puts all logs to stdout
      else
        puts "[singly] #{msg}"
      end
    end
  end
end